<template>
<div>
    <van-nav-bar
  :title="shopname"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
/>
  <van-cell v-for="(item,index) in list" :key="index">
       <template #icon>
         <img :src="item.src" width="20px" height="20px"/>
      </template>
      <template #title>
         {{item.name}}
      </template>
      <template #default>
         <a @click.stop="downoneFile(item)">下载</a>
      </template>
  </van-cell>
</div>
</template>

<script>
import showfileMixin from '@/mixin/showfrontossfile.js';
export default {
    data() {
        return {
            shopname: localStorage.getItem('shopname')?localStorage.getItem('shopname'):'', //店铺名
            list:[]
        };
    },
    methods: {
        onClickLeft() {
            this.$router.back();
         },
         async downoneFile(item){
            let downfileurl=await this.getSignatureUrl(item.path);//bucket默认xuejingres,暂时可以不填写
            let filename=item.name;
            Download(downfileurl,filename);
         },
         async getDownFiles(){
            this.id = this.$route.query.id;
            let res=await this.$frontaxios.post(this.$front.getColumnDownFile,{column_id:this.id});
            console.log(res);
            if(res.code==1){
            this.list=res.data.list;
            }
        }
    },
    mixins: [showfileMixin],
    created() {
        this.getDownFiles();
    }
};
</script>